﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VQWEB.administrator.sources;
using VQData;

namespace VQWEB.administrator.english.schedule
{
    public partial class schedule_add : System.Web.UI.Page
    {
        EnglishData EnglishData = new EnglishData();
        eng_schedule eng_schedule = null;
        int Id = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (RouteData.Values["Id"] != null)
                int.TryParse(RouteData.Values["Id"].ToString(), out Id);
            if (Id > 0)
            {
                frmSchedule.DefaultMode = FormViewMode.Edit;
                eng_schedule = EnglishData.GetScheduleById(Id);
                frmSchedule.DataSource = new List<eng_schedule> { eng_schedule };
                frmSchedule.DataBind();
            }
            else frmSchedule.DefaultMode = FormViewMode.Insert;
        }
    }
}